home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9730 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  955 b 

  1. Path: newshost.cyberramp.net!news
  2. From: sinan@cyberramp.net (John Noland)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: problem passing a string
  5. Date: 13 Mar 1996 00:15:53 GMT
  6. Organization: Prose Software
  7. Message-ID: <4i543p$83r@newshost.cyberramp.net>
  8. References: <4hrtsp$4mf@mulgave.octacon.co.uk>
  9. NNTP-Posting-Host: ramp3-25.cyberramp.net
  10. X-Newsreader: WinVN 0.99.5
  11.  
  12. In article <4hrtsp$4mf@mulgave.octacon.co.uk>, Nik.Palmer@onyx.octacon.co.uk says...
  13. >
  14. >Hi,  Im using a textoutput routine in the fastgraph package of the
  15. >form below
  16. >        void fg_print(char *string,int n);
  17. >The string that I want to pass is initialised as below
  18. >
  19. >char string[6]
  20.       ^^^^^^^^^
  21.       Should be: char string1[6];
  22.  
  23. >double variable= 1.2345
  24. >sprintf(string1,"%5f",variable)
  25.                   ^^^
  26.      Look up the conversion specifiers again. You're not using this properly.
  27.          Hint: How far to the right of the decimal do you want to go?
  28. >
  29. >fg_print(string1,5)
  30. >
  31.  
  32. -John
  33.  
  34.